﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace HHControls.CreditEducation
{
    public class HHSimpleButton : Button
    {
        #region Fields

        private bool _isClicked;
        private Color _normalBackColor = Color.White;
        private Color _normalTextColor = Color.Black;

        #endregion

        #region Properties

        public bool IsClicked
        {
            get { return _isClicked; }
            set
            {
                _isClicked = value;
                if (_isClicked)
                {
                    _normalBackColor = BackColor;
                    _normalTextColor = ForeColor;
                    BackColor = ClickedBackColor;
                    ForeColor = ClickedTextColor;
                }
                else
                {
                    BackColor = _normalBackColor;
                    ForeColor = _normalTextColor;
                }
            }
        }

        public Color ClickedTextColor { get; set; }
        public Color ClickedBackColor { get; set; }

        #endregion

        #region Constructure

        public HHSimpleButton()
        {
            FlatStyle = FlatStyle.Flat;
            FlatAppearance.BorderSize = 0;
            FlatAppearance.MouseDownBackColor = Color.LightSkyBlue;
            FlatAppearance.MouseOverBackColor = Color.LightSkyBlue;
            ClickedBackColor = Color.DimGray;
            ClickedTextColor = Color.White;
            IsClicked = false;
        }

        #endregion
    }
}